package srcInterviewPrep;

import java.util.List;

public final class Vertex
{
    private int id;
    private Object value;
    private List<Vertex> neighbors;

    public int Id()
    {
        return id;
    }

    public Object Value()
    {
        return value;
    }

    public List<Vertex> Neighbors()
    {
        return neighbors;
    }

    public Vertex(
        int id,
        Object value,
        List<Vertex> neighbors)
    {
        if (id < 0)
        {
            throw new IllegalArgumentException("id: must be greater than 0");
        }

        if (value == null)
        {
            throw new IllegalArgumentException("value must not be null");
        }

        if (neighbors == null)
        {
            throw new IllegalArgumentException("neighbors cannot be null");
        }

        this.id = id;
        this.value = value;
        this.neighbors = neighbors;

    }
    
    @Override
    public String toString()
    {
    	return "VertexId=" + this.id;
    }
}
